import { requestToData, requestToExport } from '@/api/commonHttp';

// 售价管理 - 修改售价类型 - 表单查看页面 - 信息查询
export const queryPriceAllInfoService = (data, target) => requestToData({
  url: `/sysback/saletypeupdate/getByBillUuid?billUuid=${data}`,
  type: 'post',
  target
});

// 售价管理 - 修改售价类型 - 表单查看页面 - 表尾字段查询
export const queryFooterFieldsService = data => requestToData({
  url: '/sysback/product/update/record/getByRecordNo',
  type: 'post',
  data,
  isFormData: true
});

// 售价管理 - 修改售价类型 - 模板导出
export const exportSalePriceTypeService = (data, loadingFn) => {
  const { isSaleMultiUnit, uuid, tableData } = data;
  return requestToExport({
    url: `/sysback/salepirce/up/excel/export?isSaleMultiUnit=${isSaleMultiUnit}&uuid=${uuid}`,
    type: 'post',
    data: tableData,
    loadingFn
  });
}
